<cfcomponent output="false">
	
	<!--- --->
		
	<cffunction name="resetPassword" access="public" output="true" returntype="void">
		<cfargument name="userID" required="true" />
		<cfargument name="password" required="true" />
		
		<cfset var local = {} />
		
		<!--- <cfset local.user = application.s.userService.getUserByID(arguments.userID) /> --->
		<cfset local.user = $.run.it('userService.getUserByID', {userID=arguments.userID}) />
		
		<cfif local.user.recordcount gt 0>
			<cfif arguments.password eq "">
				<cfset $.session.addMessage('invalid password') />
			<cfelse>
				<!--- <cfset application.s.emailService.resetPassword(arguments.userID,arguments.password) /> --->
				<cfset $.run.it('emailService.resetPassword', {userID=arguments.userID,password=arguments.password}) />
			</cfif>
		<cfelse>
			<cfset $.session.addMessage('invalid user for password reset') />
		</cfif>

		<cflocation url="#$.site.getVar("homeURL")#" addToken="no" />
		
	</cffunction>
	
	<!--- --->

</cfcomponent>